package SPI.javaspi;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author MaoLin Wang
 * @description
 * @date 2020/9/30 8:22 上午
 */
public class SPITest {
    public static void main(String[] args) {
        ServiceLoader<Hello> serviceLoader=ServiceLoader.load(Hello.class);
        System.out.println(Hello.class);
        Iterator<Hello> iterator = serviceLoader.iterator();
        while (iterator.hasNext()){
            iterator.next().sayHello();
        }
    }
}
